﻿using ModelLayer;
using System;
using System.Collections.Generic;

namespace ControllerLayer
{
    internal interface IReservationCtr
    {
        /// <summary>
        /// Gets the part reservations from a reservation in the database.
        /// </summary>
        /// <param name="resv">The resv.</param>
        /// <returns>List{PartReservation}.</returns>
        List<PartReservation> GetPartReservations(Reservation resv);

        /// <summary>
        /// Gets all reservations in the database.
        /// </summary>
        /// <returns>List{Reservation}.</returns>
        List<Reservation> GetAllReservations();

        /// <summary>
        /// Gets all reservations from a customer in the database.
        /// </summary>
        /// <param name="customerId">The customer identifier.</param>
        /// <returns>List{Reservation}.</returns>
        List<Reservation> GetAllReservationsFromCustomer(long customerId);

        /// <summary>
        /// Creates a reservation using dijkstra's graph search algorithm to find a suitable route.
        /// </summary>
        /// <param name="startStation">The start station.</param>
        /// <param name="endStation">The end station.</param>
        /// <param name="cust">The customer.</param>
        /// <param name="date">The date.</param>
        /// <returns>Reservation.</returns>
        Reservation CreateReservationUsingDijkstras(Station startStation, Station endStation, Customer cust, DateTime date);

        /// <summary>
        /// Gets a reservation from the database.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns>Reservation.</returns>
        Reservation GetReservation(long id);

        /// <summary>
        /// Updates a reservation in the database.
        /// </summary>
        /// <param name="resv">The resv.</param>
        /// <returns>The number of affected rows</returns>
        int UpdateReservation(Reservation resv);

        /// <summary>
        /// changes the status on a reservation in the database to accepted.
        /// </summary>
        /// <param name="resvId">The resv identifier.</param>
        /// <returns>The number of affected rows</returns>
        int AcceptReservation(long resvId);

        /// <summary>
        /// Removes a reservation from the database.
        /// </summary>
        /// <param name="resv">The resv.</param>
        /// <returns>The number of affected rows</returns>
        int CancelReservation(Reservation resv);
    }
}